package com.example.aigc_education.domain.request;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
public class AddNoteTagRequest implements Serializable {
    /**
     * id 主键
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 笔记id
     */
    private Long noteId;

    /**
     * 标签id
     */
    private Long tagId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;

    private static final long serialVersionUID = 1L;

    public AddNoteTagRequest(Long noteId, Long tagId, Long userId) {
        this.noteId = noteId;
        this.tagId = tagId;
        this.createBy = userId;
        this.createTime = LocalDateTime.now();
        this.updateBy = userId;
        this.updateTime = LocalDateTime.now();
    }
}
